<?php

use think\migration\Seeder;
use app\model\CpRule as CpRuleModel;

class CpRule extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $data = [
            [
                'id'=>1,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段相同，城市相同进行匹配。（立即匹配）',
                'immediately' => 1,
            ],
            [
                'id'=>2,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段相同，省份相同进行匹配。（48小时内）',
                'immediately' => 0,
            ],
            [
                'id'=>3,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段相同，全国随机进行匹配。（48小时内）',
                'immediately' => 0,
            ],
            [
                'id'=>4,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段不相同（取就近年龄段），城市相同进行匹配。（48小时内）',
                'immediately' => 0,
            ],
            [
                'id'=>5,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段不相同（取就近年龄段），省份相同进行匹配。（48小时内）',
                'immediately' => 0,
            ],
            [
                'id'=>6,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '性取向吻合，年龄段不相同（取就近年龄段），全国随机进行匹配。（48小时内）',
                'immediately' => 0,
            ],
            [
                'id'=>7,
                'game_id' => 'cbdca4d0-ed81-11e9-804a-00163e10428e ',
                'describe' => '执行默认匹配，将所有的匹配发送给小号。（48小时内）',
                'immediately' => 0,
            ],
        ];

        $model = new CpRuleModel();
        if($model->find(1)){

        }else{
            $model->saveAll($data,false);
        }

    }
}